require 'Json.rb'

# f = open("tmp_output_nodeStatus.txt", "w")
# f.puts(response.body)


#f = open("tmp_output_nodeStatus.txt")
#data = f.gets

host = "localhost"
path = "/cgi-bin/Game/nodeStatus.cgi"
port = "10080"
#data = Json::get_json(host, path, port)
#f = open("tmp_output_nodeStatus2.txt", "w")
#f.puts(data)


printf("Json:: get_json: [http://%s:%s/%s]\n", host, port, path)
response = Netfunc::HTTP_GET(host, path, port)
#p response.body # DEBUG
data = response.body

#f = open("tmp_output_nodeStatus.txt")
#f = open("tmp_output_nodeStatus2.txt")
#data = f.gets

data.gsub!(",}", "}")

parser = JsonParser.new
ruby_obj = parser.parse(data)

#p ruby_obj
